package com.longge;

import java.util.Arrays;
import java.util.HashSet;

public class DistinctAverages {

    public int distinctAverages(int[] nums) {

        Arrays.sort(nums);
        int left = 0 ,right = nums.length-1;
        HashSet<Double> set = new HashSet<>();
        while (left<right){
            set.add((nums[left]+(double)nums[right])/2);
            left++;
            right--;
        }
        return set.size();

    }

    public static void main(String[] args) {
        new DistinctAverages().distinctAverages(new int[]{4,1,4,0,3,5});
    }
}
